package icraf.carbon.gui;

import icraf.carbon.gui.MenuFactory.MenuProperty;
import icraf.common.gui.MenuGenerator.IconModel;

import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JToolBar;

public class ListToolBar extends JToolBar {

	private static final long serialVersionUID = -606184749333669334L;
	public JButton addB;
	public JButton removeB;

	public ListToolBar(ActionListener listener) {
		init(listener);
	}

	private void init(ActionListener listener) {
		addB = MenuFactory.createButton(MenuProperty.LIST_ADD, listener, false,
				IconModel.ICON16);
		removeB = MenuFactory.createButton(MenuProperty.LIST_REMOVE, listener,
				false, IconModel.ICON16);
		add(addB);
		add(removeB);
	}

	@Override
	public void setEnabled(boolean enabled) {
		addB.setEnabled(enabled);
		removeB.setEnabled(enabled);
		super.setEnabled(enabled);
	}

}
